package cn.whao.guli.stock.controller;

import cn.whao.guli.stock.service.StockService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * ClassName: StockController
 * Package: cn.whao.guli.stock.controller
 * Description:
 *
 * @Author 王豪
 * @Create 2024/11/26 15:53
 * @Version 1.0
 */
@RestController
@RequestMapping("/stock")
public class StockController {

    @Resource
    private StockService stockService;


    @GetMapping("{productId}/{count}")
    public Boolean updateStock(@PathVariable("productId") String productId, @PathVariable("count") Integer count) {
        return stockService.updateStockByProductId(productId, count);
    }
}
